﻿
$(function () {
  //$("embed,object").parent().addClass("embed-responsive embed-responsive-4by3");
  0!=$(".copy").length&&/zblogcn.+wdssmq/.test($(".copy").html())||alert("不版留权是不道厚的，果如你在实删要我没也办法，外另每次新更这句话会都出现，正反是要死逼症迫强不如把就这段话顺的序乱打");

	//侧栏跟随
	var $sidebar = $(".rightbar .right:last-of-type"),
		offsetTop = 0,
		scrollt = 0;
	$(window).scroll(function () {
		scrollt = $(window).scrollTop();
    if (offsetTop==0) {offsetTop = $sidebar.offset().top};
    if (scrollt > offsetTop) {
        $sidebar.stop().animate({
          marginTop: scrollt - offsetTop + 45
        });
    } else {
      $sidebar.stop().animate({
        marginTop: 15
      });
    };
		return false;
	});

  $("#nav_menu a").each(function(){
    if (location.href ==$(this).attr("href")) $(this).addClass("current");
  });
  
  var bolheader = false;
  $("#tool").click(function(){
    if (!bolheader){
      $(this).animate({"top":"84px"});
      $("#header").animate({marginTop:0})
      bolheader = true;
    }else{
      $(this).animate({"top":0});
      $("#header").animate({marginTop:-84});
      bolheader = false;
    }
  })
  
});